<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title></title>
    <script type="text/javascript" src="o.js" charset="utf-8"></script>
</head>

<body>
</body>
<script>

//TODO: implements,etc. ...

function SomeThing(){
    this.hello = function(){return "Hello World !!! "+this.toString();}
}


function Human(){
    /*[@FirstName: {type:TEXT} {default:John}]*/
	this.FirstName = "John";
    /*[@LastName: {type:TEXT} {default:Doe}]*/
	this.LastName = "Doe";

	this.Human = function(){
		console.log("Human constructor");
		if(arguments.length==2){
			this.FirstName = arguments[0];
			this.LastName = arguments[1];
		}
	}

	this.toString = function(){
        return this.FirstName+" "+this.LastName+" | "+this.getTypeName();
    }
}



mu(SuperMan).Extends(Human);
mu(SuperMan).Fextends(SomeThing);

function SuperMan(){
            this.Name;

            this.SuperMan=function(){
                console.log("SUPERMAN CONSTRUCTOR");
                this.Human(arguments[0],arguments[1]);
                this.Name = arguments[2];
                console.log(arguments[0]+"/"+arguments[1]+"/"+arguments[2]);
            }
}

var s = mu(SuperMan).New("Clark","Kent","SuperMan");
console.log(s.toString()+" --- "+s.Name);

console.log(s.hello());


mu(Girl).Extends(Human);
function Girl(){

    this.Sexe = "female";

    this.Girl = function(first,last){
        console.log("Girl constructor");
        this.Human(first,last);
    }
};

mu(Woman).Extends(Girl)
mu(Woman).Fextends(SomeThing);

function Woman(){

    this.Woman = function(){console.log("Woman constructor");}
}


var h1 = mu(Human).New();
console.log(h1.toString());

var h2 = mu(Human).New("Bob","Morane");
console.log(h2.toString());

var h3 = mu(Human).New("Sam","LePirate");
console.log(h3.toString());

//sinon plutôt que d'étendre object faire une fonction Class à l'aquelle on passe Human en paramètre et on lui
//ajoute des choses ?

var g1 = mu(Girl).New("Lara","Croft");
console.log(g1.toString());
console.log(g1.getType().name);

var w1 = mu(Woman).New("Angelina","Jolie");
console.log(w1.toString());
console.log(w1.getType().name);

console.log(mu(w1).Is(Human));
console.log(mu(w1).Is(Girl));
console.log(mu(w1).Is(Woman));

console.log(w1.hello());





</script>
</html>